package com.zgjkhis.modules.system.service.impl;

import com.github.pagehelper.PageInfo;
import com.zgjkhis.common.service.impl.BaseServiceImpl;
import com.zgjkhis.domain.PageResult;
import com.zgjkhis.modules.system.domain.TcmDiseases;
import com.zgjkhis.modules.system.service.TcmDiseasesService;
import com.zgjkhis.modules.system.service.dto.TcmDiseasesQueryCriteria;
import com.zgjkhis.modules.system.service.mapper.TcmDiseasesMapper;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author yzq
 * @Description 诊断
 * @Date 2021/6/23 9:47
 * @Param
 * @return
 **/
@Service
@AllArgsConstructor
//@CacheConfig(cacheNames = "user")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class TcmDiseasesServiceImpl extends BaseServiceImpl<TcmDiseasesMapper, TcmDiseases> implements TcmDiseasesService {

    @Override
    public PageResult<TcmDiseases> queryAll(TcmDiseasesQueryCriteria criteria, Pageable pageable) {
        getPage(pageable);
        PageInfo<TcmDiseases> page = new PageInfo<>(baseMapper.queryAll(criteria));
        return PageResult.data(page);
    }
}
